$def with(aff, relateds, adjacents, followed, beento)

$:frender.header(css = ['default/css/lite.css'], scripts = ['afflatus.js'], bignav = True, title = ('%s - %s' % (aff.title, aff.dest_name)))

<script type="text/javascript">
    $$(function () {
        if ($$.browser.msie && $$.browser.version == '6.0') {
            var img = $$('._adjacent');
            if (img.width() > 573) {
                img.width(573);
            }
        }
    });
</script>

<div id="content">
    <div class="layer">
        <div class="tube tube-b">
            <div class="block">
                <div class="mdetail mdetail-r" style="width:626px;">
                    <div class="mdtpfl clr">
                        <h1>$:aff.title - $:aff.dest_name</h1>
                        <div class="t_r" style="margin:10px auto 0 auto;">
                            <span class="handle_btn _beento span_beento" actioned="$beento" action-data="$aff.id"></span>
                            <span class="handle_btn _attention span_follow" actioned="$followed" action-data="$aff.id"></span>
                            <span class="span_1">该目的地$:travel_type_text(aff.type)处于价格监测中，想去请添加关注。</span>
                            <div class="clear"></div>
                        </div>
                    </div>
                    <div class="sep"></div>
                    <div class="mdtal mdtfst">
                        <div id="mdtimg" class="mdtiga clr">
                            <img src="$:get_media_url(aff.media_id, 0)" title="$aff.title" class="_adjacent" next="$adjacents.next" prev="$adjacents.prev" />
                        </div>
                    </div>
                    <div class="sep"></div>
                    <div class="mdtal mdtfst">$:aff.short_text</div>
                </div>
            </div>
        </div>

        <!-- right begin -->
        <div class="tube tube-a">
            <div class="block">
                <div class="mdetail mdetail-l clr" style="margin-left:-4px;display:block;">
                    <span><h2>您可能还会喜欢</h2></span>
                    $if relateds:
                        $for raff in relateds:
                            <a href="/afflatus/$raff.id"><img src="$:get_media_url(raff.media_id, 3)" width="80" height="80" title="$raff.title" /></a>
                </div>
            </div>
        
            <div class="block mt_25">
                <div class="mdetail mdetail-l clr" style="margin-left:-4px;display:block;">
                    <span>看看有谁和您一样想去这个地方</span>
                    <!-- JiaThis Button BEGIN -->
                    <div id="jiathis_style_32x32">
                        <a class="jiathis_button_qzone"></a>
                        <a class="jiathis_button_tsina"></a>
                        <a class="jiathis_button_tqq"></a>
                        <a class="jiathis_button_renren"></a>
                        <a class="jiathis_button_kaixin001"></a>
                        <a href="http://www.jiathis.com/share?uid=1512131" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
                    </div>
                    <script type="text/javascript">
                        var jiathis_config = {
                            data_track_clickback:true,
                            url: 'http://xunbaotu.com/afflatus/$aff.id',
                            title: '$aff.title - $aff.dest_name',
                            summary: '$aff.short_text'
                        };
                    </script>
                    <script type="text/javascript" src="http://v2.jiathis.com/code/jia.js?uid=1512131" charset="utf-8"></script>
                    <!-- JiaThis Button END -->
                </div>
            </div>
		</div>
        <!-- right end -->
		<div class="clear"></div>
    </div>
    
</div>
<a class="_share"></a>
<script type="text/javascript">
$$(function () {
    $$('._adjacent').aff_adjacent();
    //$$('._attention').aff_action({'callback': attention_callback});
    $$('._attention').aff_action();
    $$('._beento').aff_action({
            //'callback': beento_callback,
            'action': {
                    'text': '去过',
                    'type': 'beento',
                    'trigger': null
                },
            'actioned': {
                    'text': '已去过',
                    'type': 'unbeento'
                }
        });
    $$('._share').fancybox({
            'type': 'iframe',
            'width': 363,
            'height': 248,
            'showCloseButton': false,
            'margin': 0,
            'padding': 0
        });
});

function attention_callback(type) {
    if (type == 'follow') {
        // 弹出分享窗口
        $$('._share').attr('href', '/afflatus/share/$aff.id?mode=follow')
                    .trigger('click');
    }
};
function beento_callback(type) {
    if (type == 'beento') {
        var t = $$('<a ref="$aff.id"></a>');
        t.beento();
        t.trigger('click');
    }
}
</script>

$:frender.footer(bignav = True)
